<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <title>myApi</title>

  <meta name="keywords" content="myApi">
  <meta name="description" content="让前端更有效率的工作">

  <!--[if lt IE 9]>
  <meta http-equiv="refresh" content="0;ie.html" />
  <![endif]-->
  <link href="/static/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
  <link href="/static/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
  <link href="/static/css/animate.min.css" rel="stylesheet">
  <link href="/static/css/style.min862f.css?v=4.1.0" rel="stylesheet">
  <link rel="stylesheet" href="/static/js/plugins/ztree/css/bootstrapStyle/bootstrapStyle.css" type="text/css">

  <style>
    .jk-li span{
      font-size: 12px;
    }
    .jk-li .nav-second-level li a{
      padding-left: 15px;
      font-size: 12px;
    }

    .jk-li .jk{
      padding-left: 10px;
    }
    .ztree li a{
      color: #fff;
    }
    .ztree *{
      font-size: 12px;
      font-family: unset;
    }

    .ztree li ul {
      margin: 0;
      padding: 0 0 0 7px;
    }
  </style>

</head>

<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
<div id="wrapper">
  <!--左侧导航开始-->
  <nav class="navbar-default navbar-static-side" role="navigation">
    <div class="nav-close"><i class="fa fa-times-circle"></i>
    </div>
    <div class="sidebar-collapse">
      <ul class="nav" id="side-menu1">
        <li class="nav-header">
          <div class="dropdown profile-element" style="text-align: center;">
            <span>
              <img alt="image" class="img-circle" src="/static/img/a8.jpg" style="height: 64px;"/>
            </span>
            <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                  <span class="clear">
                      <span class="block m-t-xs">
                        <strong class="font-bold">
                          {{.User.name}}
                        </strong>
                      </span>
                  </span>
            </a>
          </div>
        </li>
        <li>
          <a class="J_menuItem" data-url="/addApi">
            <i class="fa fa-columns"></i>
            <span class="nav-label">新增接口</span>
          </a>
        </li>
        <li>
          <ul id="treeDemo" class="ztree"></ul>
        </li>
        <!-- /openApiPage?id='+children.id-->
      </ul>
    </div>
  </nav>
  <!--左侧导航结束-->
  <!--右侧部分开始-->
  <div id="page-wrapper" class="gray-bg dashbard-1">
    <div class="row border-bottom">
      <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
        <div class="navbar-header">
          <form role="search" class="navbar-form-custom" method="post" action="http://www.zi-han.net/theme/hplus/search_results.html">
            <div class="form-group">
              <input type="text" placeholder="请输入您需要查找的内容 …" class="form-control" name="top-search" id="top-search">
            </div>
          </form>
        </div>
        <ul class="nav navbar-top-links navbar-right">

          <li class="dropdown">
            <a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">
              <i class="fa fa-bell"></i> <span class="label label-primary">8</span>
            </a>
            <ul class="dropdown-menu dropdown-alerts">
              <li>
                <a href="mailbox.html">
                  <div>
                    <i class="fa fa-envelope fa-fw"></i> 您有16条未读消息
                    <span class="pull-right text-muted small">4分钟前</span>
                  </div>
                </a>
              </li>
              <li class="divider"></li>
              <li>
                <a href="profile.html">
                  <div>
                    <i class="fa fa-qq fa-fw"></i> 3条新回复
                    <span class="pull-right text-muted small">12分钟钱</span>
                  </div>
                </a>
              </li>
              <li class="divider"></li>
              <li>
                <div class="text-center link-block">
                  <a class="J_menuItem" href="notifications.html">
                    <strong>查看所有 </strong>
                    <i class="fa fa-angle-right"></i>
                  </a>
                </div>
              </li>
            </ul>
          </li>
          <li class="dropdown hidden-xs">
            <a class="right-sidebar-toggle" aria-expanded="false">
              <i class="fa fa-tasks"></i> 主题
            </a>
          </li>
        </ul>
      </nav>
    </div>
    <div class="row content-tabs">
      <button class="roll-nav roll-left J_tabLeft"><i class="fa fa-backward"></i>
      </button>
      <nav class="page-tabs J_menuTabs">
        <div class="page-tabs-content">
          <a href="javascript:;" class="active J_menuTab" data-id="index_v1.html">首页</a>
        </div>
      </nav>
      <button class="roll-nav roll-right J_tabRight"><i class="fa fa-forward"></i>
      </button>
      <div class="btn-group roll-nav roll-right">
        <button class="dropdown J_tabClose" data-toggle="dropdown">关闭操作<span class="caret"></span>

        </button>
        <ul role="menu" class="dropdown-menu dropdown-menu-right">
          <li class="J_tabShowActive"><a>定位当前选项卡</a>
          </li>
          <li class="divider"></li>
          <li class="J_tabCloseAll"><a>关闭全部选项卡</a>
          </li>
          <li class="J_tabCloseOther"><a>关闭其他选项卡</a>
          </li>
        </ul>
      </div>
    </div>
    <div class="row J_mainContent" id="content-main">
      <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="/addApi" frameborder="0" data-id="index_v1.html" seamless></iframe>
    </div>
    <div class="footer">
      <div class="pull-right">&copy; 1999-2020 <a href="#" target="_blank">myApi</a>
      </div>
    </div>
  </div>
  <!--右侧部分结束-->
  <!--右侧边栏开始-->
  <div id="right-sidebar">
    <div class="sidebar-container">

      <ul class="nav nav-tabs navs-3">

        <li class="active">
          <a data-toggle="tab" href="#tab-1">
            <i class="fa fa-gear"></i> 主题
          </a>
        </li>
        <li class=""><a data-toggle="tab" href="#tab-2">
            通知
          </a>
        </li>
        <li><a data-toggle="tab" href="#tab-3">
            项目进度
          </a>
        </li>
      </ul>

      <div class="tab-content">
        <div id="tab-1" class="tab-pane active">
          <div class="sidebar-title">
            <h3> <i class="fa fa-comments-o"></i> 主题设置</h3>
            <small><i class="fa fa-tim"></i> 你可以从这里选择和预览主题的布局和样式，这些设置会被保存在本地，下次打开的时候会直接应用这些设置。</small>
          </div>
          <div class="skin-setttings">
            <div class="title">主题设置</div>
            <div class="setings-item">
              <span>收起左侧菜单</span>
              <div class="switch">
                <div class="onoffswitch">
                  <input type="checkbox" name="collapsemenu" class="onoffswitch-checkbox" id="collapsemenu">
                  <label class="onoffswitch-label" for="collapsemenu">
                    <span class="onoffswitch-inner"></span>
                    <span class="onoffswitch-switch"></span>
                  </label>
                </div>
              </div>
            </div>
            <div class="setings-item">
              <span>固定顶部</span>

              <div class="switch">
                <div class="onoffswitch">
                  <input type="checkbox" name="fixednavbar" class="onoffswitch-checkbox" id="fixednavbar">
                  <label class="onoffswitch-label" for="fixednavbar">
                    <span class="onoffswitch-inner"></span>
                    <span class="onoffswitch-switch"></span>
                  </label>
                </div>
              </div>
            </div>
            <div class="setings-item">
                                <span>
                        固定宽度
                    </span>

              <div class="switch">
                <div class="onoffswitch">
                  <input type="checkbox" name="boxedlayout" class="onoffswitch-checkbox" id="boxedlayout">
                  <label class="onoffswitch-label" for="boxedlayout">
                    <span class="onoffswitch-inner"></span>
                    <span class="onoffswitch-switch"></span>
                  </label>
                </div>
              </div>
            </div>
            <div class="title">皮肤选择</div>
            <div class="setings-item default-skin nb">
                                <span class="skin-name ">
                         <a href="#" class="s-skin-0">
                             默认皮肤
                         </a>
                    </span>
            </div>
            <div class="setings-item blue-skin nb">
                                <span class="skin-name ">
                        <a href="#" class="s-skin-1">
                            蓝色主题
                        </a>
                    </span>
            </div>
            <div class="setings-item yellow-skin nb">
                                <span class="skin-name ">
                        <a href="#" class="s-skin-3">
                            黄色/紫色主题
                        </a>
                    </span>
            </div>
          </div>
        </div>
        <div id="tab-2" class="tab-pane">

          <div class="sidebar-title">
            <h3> <i class="fa fa-comments-o"></i> 最新通知</h3>
            <small><i class="fa fa-tim"></i> 您当前有10条未读信息</small>
          </div>

          <div>

            <div class="sidebar-message">
              <a href="#">
                <div class="pull-left text-center">
                  <img alt="image" class="img-circle message-avatar" src="/static/img/a1.jpg">

                  <div class="m-t-xs">
                    <i class="fa fa-star text-warning"></i>
                    <i class="fa fa-star text-warning"></i>
                  </div>
                </div>
                <div class="media-body">

                  据天津日报报道：瑞海公司董事长于学伟，副董事长董社轩等10人在13日上午已被控制。
                  <br>
                  <small class="text-muted">今天 4:21</small>
                </div>
              </a>
            </div>
            <div class="sidebar-message">
              <a href="#">
                <div class="pull-left text-center">
                  <img alt="image" class="img-circle message-avatar" src="/static/img/a2.jpg">
                </div>
                <div class="media-body">
                  HCY48之音乐大魔王会员专属皮肤已上线，快来一键换装拥有他，宣告你对华晨宇的爱吧！
                  <br>
                  <small class="text-muted">昨天 2:45</small>
                </div>
              </a>
            </div>
            <div class="sidebar-message">
              <a href="#">
                <div class="pull-left text-center">
                  <img alt="image" class="img-circle message-avatar" src="/static/img/a3.jpg">

                  <div class="m-t-xs">
                    <i class="fa fa-star text-warning"></i>
                    <i class="fa fa-star text-warning"></i>
                    <i class="fa fa-star text-warning"></i>
                  </div>
                </div>
                <div class="media-body">
                  写的好！与您分享
                  <br>
                  <small class="text-muted">昨天 1:10</small>
                </div>
              </a>
            </div>
            <div class="sidebar-message">
              <a href="#">
                <div class="pull-left text-center">
                  <img alt="image" class="img-circle message-avatar" src="/static/img/a4.jpg">
                </div>

                <div class="media-body">
                  国外极限小子的炼成！这还是亲生的吗！！
                  <br>
                  <small class="text-muted">昨天 8:37</small>
                </div>
              </a>
            </div>
            <div class="sidebar-message">
              <a href="#">
                <div class="pull-left text-center">
                  <img alt="image" class="img-circle message-avatar" src="/static/img/a8.jpg">
                </div>
                <div class="media-body">

                  一只流浪狗被收留后，为了减轻主人的负担，坚持自己觅食，甚至......有些东西，可能她比我们更懂。
                  <br>
                  <small class="text-muted">今天 4:21</small>
                </div>
              </a>
            </div>
            <div class="sidebar-message">
              <a href="#">
                <div class="pull-left text-center">
                  <img alt="image" class="img-circle message-avatar" src="/static/img/a7.jpg">
                </div>
                <div class="media-body">
                  这哥们的新视频又来了，创意杠杠滴，帅炸了！
                  <br>
                  <small class="text-muted">昨天 2:45</small>
                </div>
              </a>
            </div>
            <div class="sidebar-message">
              <a href="#">
                <div class="pull-left text-center">
                  <img alt="image" class="img-circle message-avatar" src="/static/img/a3.jpg">

                  <div class="m-t-xs">
                    <i class="fa fa-star text-warning"></i>
                    <i class="fa fa-star text-warning"></i>
                    <i class="fa fa-star text-warning"></i>
                  </div>
                </div>
                <div class="media-body">
                  最近在补追此剧，特别喜欢这段表白。
                  <br>
                  <small class="text-muted">昨天 1:10</small>
                </div>
              </a>
            </div>
            <div class="sidebar-message">
              <a href="#">
                <div class="pull-left text-center">
                  <img alt="image" class="img-circle message-avatar" src="/static/img/a4.jpg">
                </div>
                <div class="media-body">
                  我发起了一个投票 【你认为下午大盘会翻红吗？】
                  <br>
                  <small class="text-muted">星期一 8:37</small>
                </div>
              </a>
            </div>
          </div>

        </div>
        <div id="tab-3" class="tab-pane">

          <div class="sidebar-title">
            <h3> <i class="fa fa-cube"></i> 最新任务</h3>
            <small><i class="fa fa-tim"></i> 您当前有14个任务，10个已完成</small>
          </div>

          <ul class="sidebar-list">
            <li>
              <a href="#">
                <div class="small pull-right m-t-xs">9小时以后</div>
                <h4>市场调研</h4> 按要求接收教材；

                <div class="small">已完成： 22%</div>
                <div class="progress progress-mini">
                  <div style="width: 22%;" class="progress-bar progress-bar-warning"></div>
                </div>
                <div class="small text-muted m-t-xs">项目截止： 4:00 - 2015.10.01</div>
              </a>
            </li>
            <li>
              <a href="#">
                <div class="small pull-right m-t-xs">9小时以后</div>
                <h4>可行性报告研究报上级批准 </h4> 编写目的编写本项目进度报告的目的在于更好的控制软件开发的时间,对团队成员的 开发进度作出一个合理的比对

                <div class="small">已完成： 48%</div>
                <div class="progress progress-mini">
                  <div style="width: 48%;" class="progress-bar"></div>
                </div>
              </a>
            </li>
            <li>
              <a href="#">
                <div class="small pull-right m-t-xs">9小时以后</div>
                <h4>立项阶段</h4> 东风商用车公司 采购综合综合查询分析系统项目进度阶段性报告武汉斯迪克科技有限公司

                <div class="small">已完成： 14%</div>
                <div class="progress progress-mini">
                  <div style="width: 14%;" class="progress-bar progress-bar-info"></div>
                </div>
              </a>
            </li>
            <li>
              <a href="#">
                <span class="label label-primary pull-right">NEW</span>
                <h4>设计阶段</h4>
                <!--<div class="small pull-right m-t-xs">9小时以后</div>-->
                项目进度报告(Project Progress Report)
                <div class="small">已完成： 22%</div>
                <div class="small text-muted m-t-xs">项目截止： 4:00 - 2015.10.01</div>
              </a>
            </li>
            <li>
              <a href="#">
                <div class="small pull-right m-t-xs">9小时以后</div>
                <h4>拆迁阶段</h4> 科研项目研究进展报告 项目编号: 项目名称: 项目负责人:

                <div class="small">已完成： 22%</div>
                <div class="progress progress-mini">
                  <div style="width: 22%;" class="progress-bar progress-bar-warning"></div>
                </div>
                <div class="small text-muted m-t-xs">项目截止： 4:00 - 2015.10.01</div>
              </a>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
  <!--右侧边栏结束-->
  <!--mini聊天窗口开始-->
  <div class="small-chat-box fadeInRight animated">

    <div class="heading" draggable="true">
      <small class="chat-date pull-right">
        2015.9.1
      </small> 与 Beau-zihan 聊天中
    </div>

    <div class="content">

      <div class="left">
        <div class="author-name">
          Beau-zihan <small class="chat-date">
            10:02
          </small>
        </div>
        <div class="chat-message active">
          你好
        </div>

      </div>
      <div class="right">
        <div class="author-name">
          游客
          <small class="chat-date">
            11:24
          </small>
        </div>
        <div class="chat-message">
          你好，请问H+有帮助文档吗？
        </div>
      </div>
      <div class="left">
        <div class="author-name">
          Beau-zihan
          <small class="chat-date">
            08:45
          </small>
        </div>
        <div class="chat-message active">
          有，购买的H+源码包中有帮助文档，位于docs文件夹下
        </div>
      </div>
      <div class="right">
        <div class="author-name">
          游客
          <small class="chat-date">
            11:24
          </small>
        </div>
        <div class="chat-message">
          那除了帮助文档还提供什么样的服务？
        </div>
      </div>

    </div>
    <div class="form-chat">
      <div class="input-group input-group-sm">
        <input type="text" class="form-control">
        <span class="input-group-btn">
                        <button class="btn btn-primary" type="button">发送</button>
                    </span>
      </div>
    </div>
  </div>
  <div id="small-chat">
    <span class="badge badge-warning pull-right">5</span>
    <a class="open-small-chat">
      <i class="fa fa-comments"></i>
    </a>
  </div>
</div>
</body>
<script src="/static/js/jquery.min.js?v=2.1.4"></script>
<script src="/static/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/static/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/static/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/static/js/plugins/layer/layer.min.js"></script>
<script src="/static/js/hplus.min.js?v=4.1.0"></script>
<script type="text/javascript" src="/static/js/contabs.min.js"></script>
<script src="/static/js/plugins/pace/pace.min.js"></script>
<script src="/static/js/ajaxDataController.js"></script>
<script src="/static/event/common.js"></script>
<script src="/static/js/vue.min.js"></script>
<script src="/static/js/plugins/sweetalert/sweetalert.min.js"></script>
<script type="text/javascript" src="/static/js/plugins/ztree/js/jquery.ztree.core.js"></script>
<script type="text/javascript" src="/static/js/plugins/ztree/js/jquery.ztree.excheck.js"></script>
<script type="text/javascript" src="/static/js/plugins/ztree/js/jquery.ztree.exedit.js"></script>
<script>
  var projectId  = common.request.getParam("projectId");
  var vue = new Vue({
    el:"#wrapper",
    delimiters: ['[[', ']]'],
    data:{

    },
    created: function () {
      this.QueryLeftMenuList();
    },
    methods:{
      QueryLeftMenuList:function () {
        myAjax().post("/sys/QueryLeftMenuList",{projectId:projectId},function (data) {
              var zNodes = data.data;
              if(zNodes!=''){
                  zNodes.push({id:0, pId:-1, name:"接口列表", open:true});
                  $.fn.zTree.init($("#treeDemo"), setting, zNodes);
              }
        });
      }
    }
  });


  function toTree(data) {
    // 删除 所有 children,以防止多次调用
    data.forEach(function (item) {
      delete item.children;
    });

    // 将数据存储为 以 id 为 KEY 的 map 索引数据列
    var map = {};
    data.forEach(function (item) {
      map[item.id] = item;
    });
    var val = [];
    data.forEach(function (item) {
      // 以当前遍历项，的pid,去map对象中找到索引的id
      var parent = map[item.pid];
      // 好绕啊，如果找到索引，那么说明此项不在顶级当中,那么需要把此项添加到，他对应的父级中
      if (parent) {
        (parent.children || ( parent.children = [] )).push(item);
      } else {
        //如果没有在map中找到对应的索引ID,那么直接把 当前的item添加到 val结果集中，作为顶级
        val.push(item);
      }
    });
    return val;
  }
</script>

<SCRIPT type="text/javascript">
  <!--
  var setting = {
    view: {
      selectedMulti: false
    },
    callback: {
      onClick: function(event, treeId, treeNode, clickFlag){
          if(treeNode.level==2){
              var url = '/openApiPage?id='+treeNode.id;
              c(url,treeNode.id,treeNode.name);
          }
      }
    },
    data: {
      simpleData: {
        enable: true
      }
    }
  };


  function c(o,m,l) {
      var k = true;
      if (o == undefined || $.trim(o).length == 0) {
          return false
      }
      $(".J_menuTab").each(function () {
          if ($(this).data("id") == o) {
              if (!$(this).hasClass("active")) {
                  $(this).addClass("active").siblings(".J_menuTab").removeClass("active");
                  $(".J_mainContent .J_iframe").each(function () {
                      if ($(this).data("id") == o) {
                          $(this).show().siblings(".J_iframe").hide();
                          return false
                      }
                  })
              }
              k = false;
              return false
          }
      });
      if (k) {
          var p = '<a href="javascript:;" class="active J_menuTab" data-id="' + o + '">' + l + ' <i class="fa fa-times-circle"></i></a>';
          $(".J_menuTab").removeClass("active");
          var n = '<iframe class="J_iframe" name="iframe' + m + '" width="100%" height="100%" src="' + o + '" frameborder="0" data-id="' + o + '" seamless></iframe>';
          $(".J_mainContent").find("iframe.J_iframe").hide().parents(".J_mainContent").append(n);
          $(".J_menuTabs .page-tabs-content").append(p);
      }
      return false
  }


  //-->
</SCRIPT>
</html>
